﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
                    xmlns:c="clr-namespace:Lithnet.MetadirectoryServices;assembly=Lithnet.MetadirectoryServices"
                    xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type p:AcmaExternalExitEventExtensibleViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Label Content="Event Name"
                       Grid.Row="0"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Path=Id, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="0"
                         Grid.Column="1"
                         Margin="2" />

                <CheckBox Content="Event is disabled"
                          IsChecked="{Binding Path=IsDisabled}"
                          VerticalAlignment="Center"
                          Grid.Row="1"
                          Grid.Column="1"
                          Margin="2" />
                
                <Label Content="Extension Path"
                       Grid.Row="2"
                       Grid.Column="0"
                       Margin="2" />
                <TextBox Text="{Binding Path=ExtensionPath, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="2"
                         Grid.Column="1"
                         Margin="2" />

                <Label Content="Class Name"
                       Grid.Row="3"
                       Grid.Column="0"
                       Margin="2" />

                <TextBox Text="{Binding Path=ClassName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                         Grid.Row="3"
                         Grid.Column="1"
                         Margin="2" />

                <CheckBox Content="Execute event asynchronously"
                          IsChecked="{Binding Path=RunAsync}"
                          VerticalAlignment="Center"
                          Grid.Row="4"
                          Grid.Column="1"
                          Margin="2" />

                <Label Content="On Error"
                       Grid.Row="5"
                       Grid.Column="0"
                       Margin="2" />
                <ComboBox ItemsSource="{Binding Source={core:EnumExtension {x:Type a:AcmaEventErrorHandlingMode}}}"
                          SelectedValue="{Binding ErrorHandlingMode,  ValidatesOnDataErrors=True, ValidatesOnExceptions=true}"
                          SelectedValuePath="Value"
                          Grid.Row="5"
                          Grid.Column="1"
                          IsEnabled="{Binding Path=CanSetErrorHandlingMode, Mode=OneWay}"
                          Margin="2" />
            </Grid>
        </StackPanel>
    </DataTemplate>

</ResourceDictionary>